package com.tgm.controller;

import com.tgm.domain.vo.PortraitVO;
import com.tgm.mapper.ConsumptionRecordMapper;
import com.tgm.utils.ConsumptionDataConverter;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

import java.util.List;

/*
 * 测试AI用的controller，项目中并没有用
 */
@RestController
@RequestMapping("/ai/test")
public class ChatController {

  private final ChatClient chatClient;
  public ChatController(ChatClient.Builder builder) {
    this.chatClient = builder.build();
  }


  @GetMapping("/chat")
  public String chat(String input) {
    return this.chatClient.prompt()
        .user(input)
        .call()
        .content();
  }
}